#pragma once

#include <boost/shared_ptr.hpp>

#include <string>
#include <iostream>
#include <vector>

template<class T>
void die(T s) {
	using namespace std;
	cerr << s << endl;
		exit(1);
}

long ms();
void check(std::string errors);
std::string getFps();

std::string readFile(const char *filename);

class SuperUseHandle {
public:
	virtual ~SuperUseHandle();
};

template<class T>
class UseHandle : public SuperUseHandle {
public:
	UseHandle(T t);
	virtual ~UseHandle();
};

template<class T>
boost::shared_ptr<SuperUseHandle> newUseHandle(T t) { 
	UseHandle<T> *h=new UseHandle<T>(t); 
	return boost::shared_ptr<SuperUseHandle>(h); 
}

#define use(x) boost::shared_ptr<SuperUseHandle> useHandle=newUseHandle(x);
